package com.jackson.engineeringtechnologyguide.Transcation.controller;

/*
 * Author: JacksonCoder
 * FileName: BankController
 * Version: 1.0.0
 * Date: 2025/1/11
 */
import com.jackson.engineeringtechnologyguide.Transcation.service.BankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class BankController {

    @Autowired
    private BankService bankService;

    @GetMapping("/transfer")
    public String transferMoney(
            @RequestParam String from,
            @RequestParam String to,
            @RequestParam double amount) {
        try {
            bankService.transferMoney(from, to, amount);
            return "转账成功";
        } catch (Exception e) {
            return "转账失败: " + e.getMessage();
        }
    }


}
